﻿@namespace MudBlazor.Docs.Examples

@inject ISnackbar Snackbar


<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="ToggleOverlay" Class="mx-1">On Click Alert</MudButton>

<MudOverlay Visible="isVisible" OnClick="ShowSnackbar" DarkBackground="true" ZIndex="9999" />


@code {
    private bool isVisible;

    public void ToggleOverlay()
    {
        isVisible = true;
    }

    public void ShowSnackbar()
    {
        Snackbar.Add("Random message", Severity.Normal);
        isVisible = false;
    }
} 